﻿using System;
using System.Collections.Generic;
using System.Text;
using TSVNAddin.Config;

namespace TSVNAddinUtils
{
	public class RegisterCommandFactory : IUtilsCommandFactory
	{
		public IUtilsCommand CreateCommand()
		{
			UtilsCommandComposite commands = new UtilsCommandComposite();

			RegistryAdapter registryAdapter = new RegistryAdapter();

			commands.Add(CreateVSCommand("8.0", registryAdapter));
			commands.Add(CreateVSCommand("9.0", registryAdapter));

			commands.Add(new MakeConfigCommand(
				registryAdapter,
				new ConfigStorage(new XmlFileStorage())));

			return commands;
		}

		private IUtilsCommand CreateVSCommand(string version, RegistryAdapter registryAdapter)
		{
			return	new AddLookInFolderCommand(
				new VisualStudioConfig(registryAdapter, version));
		}

	}
}
